﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using log4net;
using log4net.Config;

namespace BasePlatformCommon
{
	public class Log
	{
		private static ILog _ilog_normal = LogManager.GetLogger("NormalLogger");
		private static ILog _ilog_test = LogManager.GetLogger("TestLogger");
		private static ILog _ilog_detectNet = LogManager.GetLogger("DetectNetLogger");
		private static ILog _ilog_detectCom = LogManager.GetLogger("DetectComLogger");
		private static ILog _ilog_debug = LogManager.GetLogger("DebugLogger");

		public static void Configure(string p_configFile)
		{
			XmlConfigurator.Configure(new FileInfo(p_configFile));
		}

		public static ILog NormalLogger
		{
			get
			{
				return _ilog_normal;
			}
		}

		public static ILog TestLogger
		{
			get
			{
				return _ilog_test;
			}
		}

		public static ILog DetectNetLogger
		{
			get
			{
				return _ilog_detectNet;
			}
		}

		public static ILog DetectComLogger
		{
			get
			{
				return _ilog_detectCom;
			}
		}

		public static ILog DebugLogger
		{
			get
			{
				return _ilog_debug;
			}
		}
	}

	// 日志文件类型枚举
	public enum LogFile
	{
		Normal = 0,
		Test = 1,
		DetectNet = 2,
		DetectCom = 3,
		Debug = 4,
		None = 5
	}

	// 日志文件输出目标枚举
	public enum LogTarget
	{
		Both = 0,
		CmdOnly = 1,
		FileOnly = 2
	}
}
